<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Vue</title>
  <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<div id="app">
  <my-component></my-component>
</div>
<script>
  // 局部注册组件
  var Child = {
    template: '<div>我的局部组件</div>'
  }

  new Vue({
    el: '#app',
    components: {
      // 局部注册组件，<my-component> 将只在父组件模板中可用
      'my-component': Child
    }
  })
</script>
</body>
</html>